home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume17 / mfold / patch02 next >
Encoding:
Internet Message Format  |  1991-02-23  |  4.1 KB

  1. From: smidt@fy.chalmers.se (Peter Smidt)
  2. Newsgroups: comp.sources.misc
  3. Subject: v17i014:  mfold - Maaniker's fold and column making, Patch02
  4. Message-ID: <1991Feb24.042057.20188@sparky.IMD.Sterling.COM>
  5. Date: 24 Feb 91 04:20:57 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 73e1194a 14112434 afb1d225 528c05ec
  8.  
  9. Submitted-by: Peter Smidt <smidt@fy.chalmers.se>
  10. Posting-number: Volume 17, Issue 14
  11. Archive-name: mfold/patch02
  12. Patch-To: mfold: Volume 15, Issue 82
  13.  
  14. This is a patch for mfold 1.05 to get 1.06. 
  15. When the insert text (using the '-i' flag) is one character long the '-n' flag
  16. won't work properly. It removes the empty lines, instead of keeping them.
  17. This patch will make the above two flags work as they are expected to do,
  18. together. ))
  19.  
  20. Peter
  21. ----
  22. #! /bin/sh
  23. # This is a shell archive.  Remove anything before this line, then unpack
  24. # it by saving it into a file and typing "sh file".  To overwrite existing
  25. # files, type "sh file -c".  You can also feed this as standard input via
  26. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  27. # will see the following message at the end:
  28. #        "End of shell archive."
  29. # Contents:  patch6.README patch6.mfold.c
  30. # Wrapped by smidt@coco on Fri Feb 22 18:44:58 1991
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'patch6.README' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'patch6.README'\"
  34. else
  35. echo shar: Extracting \"'patch6.README'\" \(464 characters\)
  36. sed "s/^X//" >'patch6.README' <<'END_OF_FILE'
  37. X*** README    Fri Feb 22 18:39:42 1991
  38. X--- ../README    Fri Feb 22 18:35:13 1991
  39. X***************
  40. X*** 1,4 ****
  41. X! Version 1.05, last change 9 february 1991.
  42. X  
  43. X  The program mfold is a simple folding and column making program.
  44. X  unpack the files from the shar file put them in a empty
  45. X--- 1,4 ----
  46. X! Version 1.06, last change 22 february 1991.
  47. X  
  48. X  The program mfold is a simple folding and column making program.
  49. X  unpack the files from the shar file put them in a empty
  50. END_OF_FILE
  51. if test 464 -ne `wc -c <'patch6.README'`; then
  52.     echo shar: \"'patch6.README'\" unpacked with wrong size!
  53. fi
  54. # end of 'patch6.README'
  55. fi
  56. if test -f 'patch6.mfold.c' -a "${1}" != "-c" ; then 
  57.   echo shar: Will not clobber existing file \"'patch6.mfold.c'\"
  58. else
  59. echo shar: Extracting \"'patch6.mfold.c'\" \(1284 characters\)
  60. sed "s/^X//" >'patch6.mfold.c' <<'END_OF_FILE'
  61. X*** mfold.c    Fri Feb 22 18:40:32 1991
  62. X--- ../mfold.c    Fri Feb 22 18:28:56 1991
  63. X***************
  64. X*** 250,259 ****
  65. X--- 250,261 ----
  66. X          if ( in != '\n' ) {
  67. X              if ( cnt_nwl > 1 && got_newlines ) {
  68. X                  while ( --cnt_nwl ) {
  69. X+                     set_putting_text(0);
  70. X                      putcolu('\n');
  71. X                      putcolu(' ');
  72. X                  }
  73. X                  putcolu('\n');
  74. X+                 set_putting_text(1);
  75. X                  DO_ALL1
  76. X              }
  77. X              cnt_nwl = 0;
  78. X***************
  79. X*** 452,459 ****
  80. X      exit(t);
  81. X  }
  82. X  
  83. X! int col = 0;
  84. X  
  85. X  putcolu(c)
  86. X  char c;
  87. X  {
  88. X--- 454,465 ----
  89. X      exit(t);
  90. X  }
  91. X  
  92. X! int col = 0, putting_text = 1;
  93. X  
  94. X+ set_putting_text(n) {
  95. X+     putting_text = n;
  96. X+ }
  97. X+ 
  98. X  putcolu(c)
  99. X  char c;
  100. X  {
  101. X***************
  102. X*** 460,472 ****
  103. X      int i;
  104. X  
  105. X      if ( c == '\n' || col == colu_chars ) {
  106. X!         if ( c == '\n' && str_len(cur_page[lin]) == ins_len ) {
  107. X              for ( i = 0; i < ins_len; i++ ) {
  108. X                  cur_page[lin][i] = '\0';
  109. X              }
  110. X              col = 0;
  111. X          }
  112. X-         if ( col ) advance_line();
  113. X          return;
  114. X      }
  115. X      cur_page[lin][col++] = c;
  116. X--- 466,479 ----
  117. X      int i;
  118. X  
  119. X      if ( c == '\n' || col == colu_chars ) {
  120. X!         if ( c == '\n' && putting_text && str_len(cur_page[lin]) == ins_len ) {
  121. X              for ( i = 0; i < ins_len; i++ ) {
  122. X                  cur_page[lin][i] = '\0';
  123. X              }
  124. X              col = 0;
  125. X+         } else {
  126. X+             advance_line();
  127. X          }
  128. X          return;
  129. X      }
  130. X      cur_page[lin][col++] = c;
  131. END_OF_FILE
  132. if test 1284 -ne `wc -c <'patch6.mfold.c'`; then
  133.     echo shar: \"'patch6.mfold.c'\" unpacked with wrong size!
  134. fi
  135. # end of 'patch6.mfold.c'
  136. fi
  137. echo shar: End of shell archive.
  138. exit 0
  139.  
  140. exit 0 # Just in case...
  141. -- 
  142. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  143. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  144. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  145. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  146.